<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>&lt;semaphore.h&gt;</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_008_351">&nbsp;</a>NAME</h4><blockquote>
semaphore.h - semaphores
(<b>REALTIME</b>)
</blockquote><h4><a name = "tag_000_008_352">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;semaphore.h&gt;
</code>
</pre>
</blockquote><h4><a name = "tag_000_008_353">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>&lt;semaphore.h&gt;</i>
header defines the
<b>sem_t</b>
type, used in performing semaphore operations.  The semaphore may be
implemented using a file descriptor, in which case applications are
able to open up at least a total of OPEN_MAX files and semaphores.
<p>
The symbol SEM_FAILED is defined (see <i><a href="sem_open.html">sem_open()</a></i>).
<p>
The following are declared as functions and may also be declared as
macros.
Function prototypes must be provided for use with an ISO C
compiler.
<pre>
<code>
int    <a href="sem_close.html">sem_close</a>(sem_t *);
int    <a href="sem_destroy.html">sem_destroy</a>(sem_t *);
int    <a href="sem_getvalue.html">sem_getvalue</a>(sem_t *, int *);
int    <a href="sem_init.html">sem_init</a>(sem_t *, int, unsigned int);
sem_t *<a href="sem_open.html">sem_open</a>(const char *, int, ...);
int    <a href="sem_post.html">sem_post</a>(sem_t *);
int    <a href="sem_trywait.html">sem_trywait</a>(sem_t *);
int    <a href="sem_unlink.html">sem_unlink</a>(const char *);
int    <a href="sem_wait.html">sem_wait</a>(sem_t *);
</code>
</pre>
<p>
Inclusion of the
<i>&lt;semaphore.h&gt;</i>
header may make visible symbols defined in the headers
<i><a href="fcntl.h.html">&lt;fcntl.h&gt;</a></i>
and
<i><a href="systypes.h.html">&lt;sys/types.h&gt;</a></i>.
</blockquote><h4><a name = "tag_000_008_354">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_355">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_356">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="fcntl.h.html">&lt;fcntl.h&gt;</a></i>,
<i><a href="systypes.h.html">&lt;sys/types.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
